package com.mzx.javase.myExtends;

/**
 * @Description:父类-动物类
 * @Date: 2021/11/13 20:40
 * @Author: MarKing
 */
public class Animal {
    String name;
    int age;
    String color;

    public Animal() {
        System.out.println("父类的无参构造方法执行了");
    }

    public void eat() {
        System.out.println("动物正在吃东西");
    }

    public void printAnimal() {
        System.out.println("name="+name+";age="+age+";color="+color);
    }
    public Animal(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}
